package com.monkeybrother.jwt.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

/**
 * @Desc
 * @Author houry
 * @Date 2021/1/5 11:30
 **/
@RestController
public class JwtController {
    @GetMapping("test")
    public String testSession(HttpServletRequest request) {
        request.setAttribute("name", "houry");
        Object jsessionid = request.getSession().getAttribute("JSESSIONID");
        System.out.println(jsessionid);
        return "success";
    }

    @GetMapping("get")
    public String get(HttpServletRequest request) {

        Object jsessionid = request.getSession().getAttribute("JSESSIONID");
        System.out.println(jsessionid);
        return "success";
    }
}
